package test.shop;

import java.util.HashMap;
import java.util.Map;

import org.junit.Test;

import test.util.HttpConnUtils;

public class ShopTest2 {

	/**
	 * 
	 * 
	 * @throws Exception
	 */
	@Test
	public void addTest() throws Exception {
		String url = "http://127.0.0.1:8088/suneee-cloud/api-offSale.getNotRefundApplys";
//		Map<String, Object> map = new HashMap<>();
//		map.put("name", "你好");
//		map.put("enterpriseCode", "suneee");
//		map.put("channelCode", "TMALL");
//		map.put("industryId", "2");
		String result = HttpConnUtils.requestInterface(url, null, HttpConnUtils.TYPE_JSON);
		System.out.println("-------------------" + result);
	}

	/**
	 * 
	 */
	@Test
	public void getTest() throws Exception {
		String url = "http://127.0.0.1:8088/suneee-cloud/api-warehouseDispose.getNotCheckedList";
		Map<String, Object> map = new HashMap<>();
		map.put("refundId", "103791625321540");
		String result = HttpConnUtils.requestInterface(url, null, HttpConnUtils.TYPE_JSON);
		System.out.println("-------------------" + result);
	}

	/**
	 * 线下费用列表
	 */
	@Test
	public void listTest() throws Exception {
		String url = "http://127.0.0.1:8088/suneee-cloud/api-financialOfflineInfo.getRecordedList";
		String result = HttpConnUtils.requestInterface(url, null, HttpConnUtils.TYPE_JSON);
		System.out.println("-------------------" + result);
	}

	/**
	 * 线下费用增加
	 */
	@Test
	public void getChannelTest() throws Exception {
		String url = "http://127.0.0.1:8088/suneee-cloud/api-financialOfflineInfo.addFinancialOfflineInfo";
		Map<String, Object> map = new HashMap<>();
		map.put("type", "商品退款");
		map.put("orderId", "22816035");
		map.put("outFee", "30");
		map.put("spuCode", "100000014");
		map.put("spuName", "鞋子");
		map.put("outTime", "2016-08-30 17:44:13");
		map.put("buyerAccount", "1234650");
		String result = HttpConnUtils.requestInterface(url, map, HttpConnUtils.TYPE_JSON);
		System.out.println("-------------------" + result);
	}
	/**
	 * 线下费用删除
	 */
	@Test
	public void findTest() throws Exception {
		String url = "http://127.0.0.1:8088/suneee-cloud/api-financialOfflineInfo.deleteFinancialOfflineInfo";
		Map<String, Object> map = new HashMap<>();
		map.put("id", "2");
//		map.put("enterpriseCode", "");
		String result = HttpConnUtils.requestInterface(url, map, HttpConnUtils.TYPE_JSON);
		System.out.println("-------------------" + result);
	}

	

}
